The present invention relates generally to an antialiasing scheme for a computer system and more particularly to providing an antialiasing scheme which minimizes memory requirements.
Computer systems are utilized extensively to render objects on a display screen. Since such display screens have a finite number of colored dots or xe2x80x9cpixelsxe2x80x9d to express the image, the exact continuous colors of the ideal image are created by displaying pixels whose color has been determined by sampling colors at discrete. As is well known, antialiasing is an approach that can be used to improve the quality of such an image by capturing more information about the color for each pixel. The number and position of these sample points, and the way their color information is combined to make the final display image, affects the perceived quality of the displayed image.
The most common way to sample an image is to take one sample for each final displayed pixel. Although this is adequate for many images, high-contrast edges will often be drawn in crude, jagged xe2x80x9cstairstepsxe2x80x9d. This is the result of treating each pixel as a single sampled point instead of as an area that may be partly covered by one color and partly by another. A much better approach is to compute the color for each pixel by blending the contributions of images that are drawn nearby and weighting the contribution of each such image in accordance with how much of the pixel is covered. This technique is called xe2x80x9cantialiasingxe2x80x9d, because it reduces the xe2x80x9caliasingxe2x80x9d effect of under-sampling which results in abrupt changes in the images. There are two common antialiasing techniques.
This first scheme for implementing antialiased image generation is referred to as the xe2x80x9cA-bufferxe2x80x9d scheme. An A-buffer is used to contain an open-ended list of all the contributions to a pixel. A list of xe2x80x9cfragmentsxe2x80x9d is maintained for each drawn object that overlaps the pixel. A xe2x80x9cfragmentxe2x80x9d is the overlap of a drawn object and a pixel, and usually includes the object""s color at that location, and optionally its depth or other parameters. When it is time to compute a single color for this pixel so it may be displayed, the list of fragments is examined and all the contributions are blended together to form a single aggregate color for the pixel.
Although many pixels may be completely covered by a single fragment, it is possible for a pixel to have any number of objects partly overlap it and to include many fragments. An A-buffer list for any one pixel may thus have any number of fragments. This is a severe disadvantage for the A-buffer scheme, since such a scheme has unbounded storage and memory bandwidth requirements, and thus adds cost and complexity to the overall system.
The second scheme for implementing antialiased image generation is referred to as the xe2x80x9cmultisamplingxe2x80x9d scheme. Multisampling represents the many fragments covering a pixel by sampling at a limited number of points within or near the pixel. The number and position of these points is chosen before rendering begins. By sampling at eight locations, for example, a rough estimate of the color and coverage of a moderate number of fragments can be obtained. To approximate a large number of fragments requires a large number of samples. A multisampling scheme with a very small number of samples (e.g., 2) is ineffective, because such a small number of sample points, chosen without knowledge of where the fragments may be for a particular pixel, are very unlikely to provide an accurate representation of the fragments and especially of their contribution to the pixel. Multisampling has fixed storage requirements because it has a fixed number of samples per pixel, but it is wasteful of storage and memory bandwidth since many pixels may have the same color repeated in each sample.
To implement antialiasing efficiently in computer system requires an approach that limits storage, bandwidth, and complexity requirements, while still providing a reasonable representation of the fragments that cover each pixel. The present invention addresses such a need.
A method and system for efficiently rendering and displaying color information of a pixel in a computer system is disclosed. Each pixel includes a plurality of fragments. The method and system comprises providing a weighted average of the color information of a plurality of fragments for a pixel to a first portion of a register. The register is within a data structure in the computer system. The method and system also includes providing the color information of pre-selected fragments, except the one with the largest pixel coverage, to at least one additional portion of the register. The method and system further includes sending the register to a memory in the computer system, and sending it subsequently from that memory to a display without further processing.
A method and system in accordance with the present invention allows one to eliminate the resolving step associated with the conventional A-buffer antialiasing scheme and limits the memory, bandwidth and complexity of the system. Accordingly, it is cost-effective while maintaining high image quality.